//
//  FourviewController.m
//  dongdongbook
//
//  Created by yaotd-PC on 2017/12/20.
//  Copyright © 2017年 yaotengdong. All rights reserved.
//

#import "FourviewController.h"
#import "MyTableViewCell.h"

@interface FourviewController ()<UITableViewDelegate, UITableViewDataSource>
@property (nonatomic, retain)UITableView *MyTableview;
@property (nonatomic, retain)NSArray *myArr;

@end

@implementation FourviewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    _myArr = [NSArray array];
    _myArr = @[@"登录", @"我的收藏", @"夜间模式", @"个性皮肤", @"设置", @"意见反馈"];
    
    self.MyTableview = [[UITableView alloc] initWithFrame:CGRectMake(0, 0, self.view.frame.size.width, self.view.frame.size.height) style:UITableViewStylePlain];
    self.MyTableview.delegate = self;
    self.MyTableview.dataSource = self;
    [self.view addSubview: self.MyTableview];
    
}
-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
    return _myArr.count;
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    static NSString *reused = @"reused";
    NSArray *arr = @[@"登录.png", @"我的收藏.png", @"夜间模式.png", @"个性皮肤.png", @"设置.png", @"意见反馈.png"];
    MyTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:reused];
    if (cell == nil) {
        cell = [[MyTableViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:reused];
    }
    cell.myLable.text = [_myArr objectAtIndex:indexPath.row];
    [cell.myImageviewSecond setImage:[UIImage imageNamed:@"箭头.png"]];
    cell.myImageviewOne.image = [UIImage imageNamed:[arr objectAtIndex:indexPath.row]];
    return cell;
}
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
    NSLog(@"%ld", indexPath.row);
}
- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
